import java.io.*;
import java.util.*;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

public class caller {
	public static void main(String agrv[]) throws NamingException, IOException {
		try {
			Properties p = new Properties();
			p.setProperty(Context.INITIAL_CONTEXT_FACTORY,
					"org.jnp.interfaces.NamingContextFactory");
			p.setProperty(Context.PROVIDER_URL, "localhost:1099");

			Context ctx = new InitialContext(p);

			final IHelloWorld ah = (IHelloWorld) ctx
					.lookup("HelloWorldBean/remote");

			// System.out.println("Hello World");

			// System.out.println(ah.say("hello bean..."));
			ah.say("hello bean...");
			// final client test = new client();
			// Start the timer
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}
}
